package sort;

import java.util.Arrays;

public class SelectSort {
	public static void main(String[] args) {
		int[] arr = new int[]{3,6,1,8,2,0};
		selectSort(arr);
		System.out.println(Arrays.toString(arr));
	}
	private static void selectSort(int[] arr){
		int temp = 0;
		for(int i=0; i<arr.length-1; i++){
			for(int j=i+1; j<arr.length; j++){
				if(arr[i]>arr[j]){
					temp = arr[i];
					arr[i] = arr[j];
					arr[j] = temp;
				}
			}
		}
	}
}
